<?php
require_once "settings.php";
require_once "messages.php";
require_once "sessions.php";

function show_page() {
  global $message_text, $path, $style, $header;

  $filename = $path[$style]["tpl"]."/login.htm";
  $fp = fopen($filename, "r");
  $contents = fread($fp, filesize ($filename));
  fclose ($fp);

  $contents = str_replace("%ROOT_CSS%", $path[$style]["css"], $contents);

  $contents = str_replace("%LOGIN%", getMessage("Login"), $contents);
  $contents = str_replace("%PASSWORD%", getMessage("Password"), $contents);
  $contents = str_replace("%SUBMIT%", getMessage("Enter"), $contents);
  $contents = str_replace("%MESSAGE%", $message_text, $contents);

  header ($header["html"]);
  header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
  header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
  header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1
  header ("Pragma: no-cache");                          // HTTP/1.0

  print ($contents);
}
?>